package com.fujitsu.nanjing.tieba.dao;

import com.fujitsu.nanjing.tieba.ibator.CoreBackupTask;
import com.fujitsu.nanjing.tieba.ibator.CoreBackupTaskCriteria;
import java.util.List;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

public class CoreBackupTaskDAOImpl extends SqlMapClientDaoSupport implements CoreBackupTaskDAO {

    public CoreBackupTaskDAOImpl() {
        super();
    }

    public int countByExample(CoreBackupTaskCriteria example) {
        Integer count = (Integer)  getSqlMapClientTemplate().queryForObject("core_backup_task.countByExample", example);
        return count;
    }

    public int deleteByExample(CoreBackupTaskCriteria example) {
        int rows = getSqlMapClientTemplate().delete("core_backup_task.deleteByExample", example);
        return rows;
    }

    public int deleteByPrimaryKey(Integer taskid) {
        CoreBackupTask _key = new CoreBackupTask();
        _key.setTaskid(taskid);
        int rows = getSqlMapClientTemplate().delete("core_backup_task.deleteByPrimaryKey", _key);
        return rows;
    }

    public void insert(CoreBackupTask record) {
        getSqlMapClientTemplate().insert("core_backup_task.insert", record);
    }

    public void insertSelective(CoreBackupTask record) {
        getSqlMapClientTemplate().insert("core_backup_task.insertSelective", record);
    }

    @SuppressWarnings("unchecked")
    public List<CoreBackupTask> selectByExample(CoreBackupTaskCriteria example) {
        List<CoreBackupTask> list = getSqlMapClientTemplate().queryForList("core_backup_task.selectByExample", example);
        return list;
    }

    public CoreBackupTask selectByPrimaryKey(Integer taskid) {
        CoreBackupTask _key = new CoreBackupTask();
        _key.setTaskid(taskid);
        CoreBackupTask record = (CoreBackupTask) getSqlMapClientTemplate().queryForObject("core_backup_task.selectByPrimaryKey", _key);
        return record;
    }

    public int updateByExampleSelective(CoreBackupTask record, CoreBackupTaskCriteria example) {
        UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
        int rows = getSqlMapClientTemplate().update("core_backup_task.updateByExampleSelective", parms);
        return rows;
    }

    public int updateByExample(CoreBackupTask record, CoreBackupTaskCriteria example) {
        UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
        int rows = getSqlMapClientTemplate().update("core_backup_task.updateByExample", parms);
        return rows;
    }

    public int updateByPrimaryKeySelective(CoreBackupTask record) {
        int rows = getSqlMapClientTemplate().update("core_backup_task.updateByPrimaryKeySelective", record);
        return rows;
    }

    public int updateByPrimaryKey(CoreBackupTask record) {
        int rows = getSqlMapClientTemplate().update("core_backup_task.updateByPrimaryKey", record);
        return rows;
    }

    protected static class UpdateByExampleParms extends CoreBackupTaskCriteria {
        private Object record;

        public UpdateByExampleParms(Object record, CoreBackupTaskCriteria example) {
            super(example);
            this.record = record;
        }

        public Object getRecord() {
            return record;
        }
    }
}